<template>
  <div class="banner">
    <div class="banxin">
      <img :src="src" alt="" />
      <!-- 我们希望，banner可以是能点，也可以是不能点的 -->
      <a v-if="href" :href="href"></a>
    </div>
  </div>
</template>
 
<script>
export default {
  props: ["src","href"],
  data() {
    return {};
  },
};
</script>
 
<style lang = "less" scoped>
.banner {
    position: relative;
    img {
        width: 100%;
    }
    a {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
    }
}
</style>